#-*- coding:utf-8 -*-

from django.contrib import admin
import models
# Register your models here.
'''
在admin后台显示models表的那些字段，
1、创建一个class必须继承admin.ModelAdmin，
2、设置静态字段list_display，显示哪些字段
3、register时，把class对象作为参数传入
'''

class ArticleAdmin(admin.ModelAdmin):
    list_display = ('id','title','author','plate','img','summary','content','publish_date')
admin.site.register(models.Article,ArticleAdmin)

class PlateAdmin(admin.ModelAdmin):
    list_display = ('id','plate')
admin.site.register(models.Plate,PlateAdmin)

class CommentAdmin(admin.ModelAdmin):
    list_display = ('id','article','user','parent_comment','comment','date')
admin.site.register(models.Comment,CommentAdmin)
admin.site.register(models.UserInfo)
admin.site.register(models.UserGroup)